forum

home / developersection / forums / extracting texts from html tags

Extracting texts from html tags

Anonymous User 2035 20-Sep-2014

I have a page like this which has 3 values in li tags

<li>Samsung</li>
<li>Nokia</li>
<li>Sony</li>
 
public string mobilename1 = "";
public string mobilename2 = "";
public string mobilename3 = "";
 
 
    // Use this for initialization
    void Start () {
 
        HtmlWeb htmlweb = new HtmlWeb();
        HtmlAgilityPack.HtmlDocument doc = htmlweb.Load(openUrl);
 
    foreach (HtmlNode nd in doc.DocumentNode.SelectNodes("//li"))
        {
            mobilenames=nd.InnerText.ToString();
 
        }

 

How can I store all 3 values in those strings?


c# c#  .net 
Updated on 20-Sep-2014

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By